import { Dayjs } from 'dayjs';
export interface SearchInfo {
	eventId?: number;
	userId?: number;
	registrationTime?: Dayjs | string;
	registrationTimeFrom?: Dayjs | string;
	registrationTimeTo?: Dayjs | string;
	paymentStatus?: boolean;
	paymentAmount?: number;
	identityVerificationVo?: {
		name?: string;
		idCardNumber?: string;
	};
}

export interface pageInfo {
	current?: number;
	pageSize?: number;
	total?: number;
	showTotal: Function;
	showSizeChanger: boolean;
	pageSizeOptions: string[];
	showSizeChange: Function;
	size: string;
	showQuickJumper: boolean;
	defaultPageSize: number;
}

export let pagination = ref<any>({
	// 数据总数
	total: 0,
	// 当前页数
	current: 1,
	// 每页条数
	pageSize: 10,
	// 展示总数
	showTotal: (total: number) => `共 ${total} 条`,
	// 是否可以改变pageSize
	showSizeChanger: true,
	// 设置每页可以展示多少条的选项
	pageSizeOptions: ['10', '20', '50', '100'],
	// 改变pageSize后触发
	showSizeChange: (current: number, pageSize: any) => (
		(pagination.value.current = current),
		(pagination.value.pageSize = pageSize)
	),
	// 小尺寸分页
	size: 'small',
	// 是否可以快速跳转至某页
	showQuickJumper: true,
	//默认条数
	defaultPageSize: 10,
});

export const columns = ref<any>([
	{
		title: '活动名称',
		dataIndex: 'eventId',
		key: 'eventId',
	},
	{
		title: '报名人编码',
		dataIndex: 'code',
		width: '90px',
		key: 'code',
	},
	{
		title: '报名人昵称',
		dataIndex: 'nickname',
		width: '120px',
		key: 'nickname',
	},
	{
		title: '真实姓名',
		dataIndex: 'identityName',
		key: 'identityName',
		width: '110px',
	},
	{
		title: '身份证号',
		dataIndex: 'identityIdCardNumber',
		key: 'identityIdCardNumber',
		width: '160px',
	},
	{
		title: '电话',
		dataIndex: 'phone',
		width: '120px',
		key: 'phone',
	},
	{
		title: '报名时间',
		dataIndex: 'registrationTime',
		width: '160px',
		key: 'registrationTime',
	},
	{
		title: '报名支付金额',
		dataIndex: 'paymentAmount',
		width: '110px',
		key: 'paymentAmount',
	},
	// 报名人-基本信息字段
	{ title: '性别', dataIndex: 'gender', key: 'gender', width: '60px' },
	{ title: '年龄', dataIndex: 'age', key: 'age', width: '80px' },
	{ title: '身高', dataIndex: 'height', key: 'height', width: '60px' },
	{ title: '体重', dataIndex: 'weight', key: 'weight', width: '60px' },
	{ title: '职业', dataIndex: 'profession', key: 'profession', width: '120px' },
	{ title: '收入', dataIndex: 'income', key: 'income', width: '120px' },
	{ title: '地区', dataIndex: 'region', key: 'region', width: '180px' },
	// 择偶要求-概览 & 细分
	{ title: '择偶-年龄', dataIndex: 'prefAge', key: 'prefAge', width: '140px' },
	{
		title: '择偶-身高(cm)',
		dataIndex: 'prefHeight',
		key: 'prefHeight',
		width: '160px',
	},
	{
		title: '择偶-体重(kg)',
		dataIndex: 'prefWeight',
		key: 'prefWeight',
		width: '160px',
	},
	{
		title: '择偶-学历',
		dataIndex: 'prefEducationLevel',
		key: 'prefEducationLevel',
		width: '120px',
	},
	{
		title: '择偶-职业',
		dataIndex: 'prefProfession',
		key: 'prefProfession',
		width: '120px',
	},
	{
		title: '择偶-收入范围',
		dataIndex: 'prefIncomeRange',
		key: 'prefIncomeRange',
		width: '140px',
	},
	{
		title: '择偶-车房情况',
		dataIndex: 'prefHousingCarStatus',
		key: 'prefHousingCarStatus',
		width: '140px',
	},
	{
		title: '择偶-婚姻状况',
		dataIndex: 'prefMaritalStatus',
		key: 'prefMaritalStatus',
		width: '120px',
	},
	{
		title: '择偶-地区',
		dataIndex: 'prefRegion',
		key: 'prefRegion',
		width: '180px',
	},
	{
		title: '操作',
		key: 'operation',
		fixed: 'right',
		width: '100px',
	},
]);

export interface DataItem {
	eventId: number;
	userId: number;
	registrationTime?: Dayjs | string;
	paymentStatus: boolean;
	paymentAmount: number;
}

export interface ModelInfo {
	title?: string;
	width?: string;
	id?: number | undefined;
	confirmLoading?: boolean;
}

export interface dictInfo {
	typeCode?: string | number | undefined;
	typeName?: string | undefined;
}
